{% extends 'base.html' %}
{% block content %}
    {{pagination.links}}
    {% if flag %}
        <a href="/admin" class="header-btn"><button>发送动态</button></a>
        <a href="/command/logout" class="header-btn"><button>登出</button></a>
    {% endif %}
    {% if text.count() %}
        {% for t in text %}
            <div class="text-box">
                {%if t['imgP']%}
                    <div class="img-box">
                        <img src="/img/{{ t['imgP'] }}">
                    </div>
                {% endif %}
                <textarea class="text" readonly cols='100' rows='15' >{{t['text']}}</textarea>
                <p  class="date"><small>{{t['date']}}</small></p>
                {% if flag %}
                    <button @click="delete_text({{t.id}})">删除</button>
                    <a href="/change_text/{{t.id}}"><button>修改</button></a>
                {% endif %}
            </div>
        {% endfor %}   
    {% else %}
        <p>/login:登陆</p>
        <p>快去发一条动态试试吧！</p>
    {% endif %}
    {{pagination.links}}
{% endblock content %}